﻿Imports CapaLogica.CL.Bitacora

Public Class frmBuscarBitacora

    Private Sub btnBuscar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBuscar.Click

        Dim accion As String

        accion = Nothing

        If (cmbAccion.SelectedIndex < 0) Then

        ElseIf (cmbAccion.SelectedItem.ToString = "Registros") Then
            accion = "Inserción"

        ElseIf (cmbAccion.SelectedItem.ToString = "Eliminaciones") Then
            accion = "Eliminación"

        ElseIf (cmbAccion.SelectedItem.ToString = "Modificaciones") Then
            accion = "Modificación"

        ElseIf (cmbAccion.SelectedItem.ToString = "Activaciones") Then
            accion = "Activación"

        ElseIf (cmbAccion.SelectedItem.ToString = "Desactivaciones") Then
            accion = "Desactivación"
        End If


        Dim fechaInicio As DateTime
        fechaInicio = Convert.ToDateTime(dtFechaInicio.Text)

        Dim fechaFin As DateTime
        fechaFin = Convert.ToDateTime(dtFechaFin.Text)

        DataGridBitacora.DataSource = GestorBitacora.buscarBitacora(accion, fechaInicio, fechaFin)
    End Sub


    Private Sub btnRefrescar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRefrescar.Click
        refrescar()
    End Sub

    Private Sub refrescar()
        DataGridBitacora.DataSource = Nothing
        limpiarComboBox(cmbAccion)
    End Sub

    Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
        Me.Dispose()
    End Sub
End Class